<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>换肤</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        body{
            background: url("./imgs/1.jpg") no-repeat;
        }
        .box{
            padding: 50px 0px;
           text-align: center;
           background: rgba(225, 225,225, .3);
        }
        .box img{
            cursor: pointer;
        }
    </style>
    <script>
        window.onload=function(){
            var imgs=document.getElementsByTagName("img");
            for(let i=0;i<imgs.length;i++){
                imgs[i].onclick=function(){
                    document.body.style.backgroundImage="url('./imgs/"+(i+1)+".jpg')";
                }
            }

        }
    </script>
</head>
<body>
    <div class="box">
        <img src="./imgs/1.jpg" width="150px">
        <img src="./imgs/2.jpg" width="150px">
        <img src="./imgs/3.jpg" width="150px">
        <img src="./imgs/4.jpg" width="150px">
        <img src="./imgs/4.jpg" width="150px">
    </div>
</body>
</html>